package com.xiaozhengkeji.sc.service;



import com.xiaozhengkeji.sc.bean.ResponseBean;
import com.xiaozhengkeji.sc.pojo.UserPoJo;
import com.xiaozhengkeji.sc.service.imp.UserServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "Authorization-Server" ,fallback = UserServiceFallback.class)
@Service
public interface UserServiceFeign {

    @GetMapping("/info")
    UserPoJo info(@RequestParam("token") String token);

    @PostMapping("/login")
    ResponseBean login(@RequestParam("username") String username,
                       @RequestParam("password") String password);

    @PostMapping("/register")
    ResponseBean register(@RequestParam("username") String username,
                          @RequestParam("password") String password);

    @GetMapping("/out")
    void out(@RequestParam("token") String token);
}
